<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script>
			window.onload = function(){
				
				setTimeout(function(){
					console.log("timeout 2000")
				}, 2000);
				
				setTimeout(function(){
					console.log("timeout 1000")
				}, 1000);
				
				function fun(){
					console.log("js是单线程执行的")
				}
				fun()
				
				console.log("alert之前")
				alert("--------")  // 暂停当前主线程的执行, 同时暂停计时, 点击确定后, 回复程序执行和计时器
				console.log("alert之后")
			}
		</script>
	</head>
	<body>
	</body>
</html>
